package com.easyweb.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.easyweb.dao.ArticleDao;
import com.easyweb.model.Article;
import com.easyweb.service.ArticleService;

@Service
public class ArticleServiceImpl implements ArticleService{

	@Autowired
	private ArticleDao articleDao;
	
	public int insertArticle(Article article) {
		return articleDao.insertArticle(article);
	}

	public int deleteArticleById(Map<String, Object> map) {
		return articleDao.deleteArticleById(map);
	}

	public int updateArticle(Article article) {
		return articleDao.updateArticle(article);
	}

	public List<Article> getArticles(Map<String, Object> map) {
		return articleDao.getArticlesNoContent(map);
	}

	public Article getArticleById(Map<String, Object> map) {
		return articleDao.getArticleById(map);
	}

	public List<Article> getIndexArticle(Map<String, Object> map) {
		return articleDao.getIndexArticle(map);
	}

	public List<Article> getSortArticleByRead(Map<String, Object> map) {
		return articleDao.getSortArticleByRead(map);
	}

	public int getIndexArticleCount(Map<String, Object> map) {
		return articleDao.getIndexArticleCount(map);
	}

	public int getArticlesCount(Map<String, Object> map) {
		return articleDao.getArticlesNoContentCount(map);
	}

}
